package com.example.dw.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 活动评论实体类
 * @author system
 * @since 2024-01-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("activity_comment")
public class ActivityComment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 评论ID
     */
    @TableId(value = "commentid", type = IdType.AUTO)
    private Integer commentid;

    /**
     * 用户ID
     */
    @TableField("userid")
    private Integer userid;

    /**
     * 活动ID
     */
    @TableField("activityid")
    private Integer activityid;

    /**
     * 评分（星级）
     */
    @TableField("stars")
    private Integer stars;

    /**
     * 评论内容
     */
    @TableField("content")
    private String content;

    /**
     * 创建时间
     */
    @TableField("createdAt")
    private LocalDateTime createdAt;

    // 非数据库字段，用于关联查询
    /**
     * 用户名
     */
    @TableField(exist = false)
    private String username;

    /**
     * 用户昵称
     */
    @TableField(exist = false)
    private String nickname;

    /**
     * 用户头像
     */
    @TableField(exist = false)
    private String avatar;
} 